package com.example.restful01.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.restful01.mapper.BookMapper;
import com.example.restful01.mapper.CommentsMapper;
import com.example.restful01.model.Book;
import com.example.restful01.model.Comments;
import com.example.restful01.service.BookService;
import com.example.restful01.service.CommentsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CommentsServiceImpl extends ServiceImpl<CommentsMapper, Comments> implements CommentsService {
    @Autowired
    private CommentsMapper commentsMapper;
    @Override
    public int addPraise(Integer commentId) {
       return commentsMapper.addPraise(commentId);
    }

    @Override
    public int addComment(Comments comments) {
        return commentsMapper.addComment(comments);
    }

    @Override
    public boolean reportComment(Comments comments) {
        return commentsMapper.reportComment(comments)>0;
    }
}
